package daoImpl;

import java.util.ArrayList;
import java.util.List;

import model.Device;
import model.Room;
import dao.DeviceDao;


public class DeviceDaoImpl implements DeviceDao{
	
	public List<Device>	devices	= new ArrayList<Device>();
	
	
	public void add( Device device ) {
		devices.add( device );
	}
	
	
	public void delete( Device device ) {
		devices.remove( device );
	}
	
	
	public void update( Device device ) {
	}
	
	public List<Device> getDevices(){
		return devices;
	}
	
	@Override
	public boolean deviceExcists( int device_nr ) {
		for( Device device : devices ){
			if( device.getId() == device_nr ){
				return true;
			}
		}
		return false;
	}


	@Override
	public void setMemento( List<Device> devices ) {
		this.devices = devices;
	}
}
